package com.yx.yinshanjinniu.adapters;

import android.content.Context;
import android.view.View;
import android.widget.TextView;

import com.yx.yinshanjinniu.R;
import com.yx.yinshanjinniu.base.BaseRVAdapter;
import com.yx.yinshanjinniu.base.BaseRVHolder;
import com.yx.yinshanjinniu.bean.HomeHotBean;
import com.yx.yinshanjinniu.utils.StringUtil;

import java.util.List;

public class OtherArticleAdapter extends BaseRVAdapter<HomeHotBean> {
    private int selectedPosition = 0;

    public OtherArticleAdapter(Context context, List<HomeHotBean> list) {
        super(context, list);
    }

    @Override
    public int onCreateViewLayoutID(int viewType) {
        return R.layout.item_hot_other;
    }

    @Override
    public void onBindView(BaseRVHolder holder, int position) {
        HomeHotBean homeHotBean = mList.get(position);
        TextView tv_time = holder.getViewHolder().get(R.id.tv_time);
        TextView tv_top = holder.getViewHolder().get(R.id.tv_top);
        TextView tv_title = holder.getViewHolder().get(R.id.tv_title);
        tv_time.setText(homeHotBean.add_time);
        tv_title.setText(homeHotBean.title);
        tv_top.setVisibility(StringUtil.isEmpty(homeHotBean.add_name) ? View.GONE : View.VISIBLE);
    }

}
